package com.xiaoke.annotation;

import com.xiaoke.validator.CategoryExistValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 判断分类是否存在
 */
@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = CategoryExistValidator.class)
public @interface CategoryExist {
    String message() default "分类ID不存在";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
